home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesC-D.lzh / Drakkhen.lha / DrakkhenHd / Install < prev    next >
Text File  |  2001-09-27  |  6KB  |  337 lines

  1. ;****************************
  2.  
  3. (set #readme-file "ReadMe")      ;name of the readme file
  4. (set #highs-file "highs")     ;name of high scores file
  5. (set #osemu-file "OSEmu.400")     ;name of high scores file
  6. (set #disk-name ("%s.d1" @app-name))     ;file disk image
  7. (set #cheat-file "cheat.lha")      ;name of the readme file
  8. (set #save-file "drakkhen.save")      ;name of the readme file
  9.                          
  10. (procedure P_MakeImages
  11.  
  12.   ;the following lines must be copied and adjusted for multiple disk images
  13.  
  14.   (set #CI_disknum 1)
  15.   (set #CI_diskname ("%s Game Disk %ld" @app-name #CI_disknum))
  16.   (set #CI_disklen $dc000)
  17.   (set #CI_skiptrk "2,3")
  18.   (P_CreateImage)
  19.  
  20.     (set #CI_disknum 2)
  21.   (set #CI_diskname ("%s Creation Disk %ld" @app-name #CI_disknum))
  22.   (set #CI_disklen $dc000)
  23.   (set #CI_skiptrk -1)
  24.   (P_CreateImage)
  25.  
  26. )
  27.  
  28.  
  29. (procedure P_RenameImages
  30.  
  31.  ;the following lines must be copied and adjusted for multiple disk images
  32.    (run
  33.         (cat
  34.           "cd \"" #dest "\"\n"
  35.           "rename disk.1 " #disk-name
  36.         )
  37.    )
  38.  
  39.  
  40. )
  41.  
  42.  
  43. ;****************************
  44. ;----------------------------
  45. ; checks if given program is installed, if not abort install
  46. ; #program - to check
  47.  
  48. (procedure P_ChkRun
  49.   (if
  50.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  51.     ("")
  52.     (abort 
  53.       (cat
  54.    "You must install \"" #program "\" first!\n"
  55.    "It must be accessible via the path.\n"
  56.    "You can find it in the WHDLoad package."
  57.       )
  58.     )
  59.   )
  60. )
  61.  
  62. ;----------------------------
  63. ; Create Image using DIC
  64. ; #dest        - path to save image in
  65. ; #CI_disknum  - number of the disk image to create
  66. ; #CI_diskname - label of the disk
  67. ; #CI_disklen  - length of disk image to create
  68. ; #CI_skiptrk  - track to skip, -1 means no skip
  69. ; #CI_drive    - drive to create image from
  70.  
  71. (procedure P_CreateImage
  72.   (message
  73.     (cat
  74.    "\nInsert \"" #CI_diskname "\" into drive " #CI_drive "!\n\n"
  75.    "(make sure it's the right disk because it will not be checked)"
  76.     )
  77.   )
  78.   (if
  79.     (>= #CI_skiptrk 0)
  80.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  81.     (set #option "")
  82.   )
  83.   (if
  84.     (= 0
  85.       (run 
  86.         (cat
  87.           "cd \"" #dest "\"\n"
  88.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  89.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  90.         )
  91.       )
  92.     )
  93.     (run ("FileNote \"%s.%ld\" \"%s\" Quiet" (tackon #dest "disk") #CI_disknum @app-name))
  94.     (abort "\"DIC\" has failed to create a diskimage")
  95.   )
  96. )
  97.  
  98. ;****************************
  99.  
  100. (if
  101.   (exists #readme-file)
  102.   (if
  103.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  104.     ("")
  105.     (run ("SYS:Utilities/More %s" #readme-file))
  106.   )
  107. )
  108.  
  109. (set #program "WHDLoad")
  110. (P_ChkRun)
  111.  
  112. (set #program "DIC")
  113. (P_ChkRun)
  114.  
  115. ; in expert mode ask for source drive
  116. (if
  117.   (= @user-level 2)
  118.   (
  119.     (set #CI_drive
  120.       (askchoice
  121.    (prompt "Select source drive for diskimages")
  122.    (default 0)
  123.    (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  124.    (help @askchoice-help)
  125.       )
  126.     )
  127.     (select #CI_drive
  128.       (set #CI_drive "DF0:")
  129.       (set #CI_drive "DF1:")
  130.       (set #CI_drive "RAD:")
  131.       (set #CI_drive
  132.         (askstring
  133.           (prompt "Select source drive for diskimages")
  134.           (default "DF0:")
  135.           (help @askstring-help)
  136.         )
  137.       )
  138.     )
  139.   )
  140.   (set #CI_drive "DF0:")
  141. )
  142.  
  143. (set @default-dest
  144.   (askdir
  145.     (prompt 
  146.       (cat
  147.    "Where should \"" @app-name "\" be installed?\n"
  148.    "A drawer \"" @app-name "\" will be automatically created."
  149.       )
  150.     )
  151.     (help @askdir-help)
  152.     (default @default-dest)
  153.     (disk)
  154.   )
  155. )
  156. (set #dest (tackon @default-dest @app-name))
  157. (if
  158.   (exists #dest)
  159.   (
  160.     (set #choice
  161.       (askbool
  162.         (prompt
  163.           (cat
  164.             "\nDirectory \"" #dest "\" already exists.\n"
  165.             "Should it be deleted?"
  166.           )
  167.         )
  168.         (default 1)
  169.         (choices "Delete" "Skip")
  170.         (help @askbool-help)
  171.       )
  172.     )
  173.     (if
  174.       (= #choice 1)
  175.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  176.     )
  177.   )
  178. )
  179. (makedir #dest
  180.   (help @makedir-help)
  181.   (infos)
  182. )
  183.  
  184. ;----------------------------
  185.  
  186. (copyfiles
  187.   (help @copyfiles-help)
  188.   (source ("%s.Slave" @app-name))
  189.   (dest #dest)
  190. )
  191.  
  192. (copyfiles
  193.   (help @copyfiles-help)
  194.   (source ("%screation.Slave" @app-name))
  195.   (dest #dest)
  196. )
  197.  
  198. (if
  199.   (exists ("%s.glowicon" @app-name))
  200.   (set #icon
  201.     (askchoice
  202.       (prompt "\nWhich icon would you like to install for game disk?\n")
  203.       (default 0)
  204.       (choices "Normal" "GlowIcon")
  205.       (help @askchoice-help)
  206.     )
  207.   )
  208.   (set #icon 0)
  209. )
  210. (select #icon
  211.   (set #icon ("%s.inf" @app-name))
  212.   (set #icon ("%s.Glowicon" @app-name))
  213. )
  214.  
  215. (copyfiles
  216.   (help @copyfiles-help)
  217.   (source #icon)
  218.   (newname ("%s.info" @app-name))
  219.   (dest #dest)
  220. )
  221.  
  222.  
  223. (if
  224.   (exists ("%sCreation.glowicon" @app-name))
  225.   (set #icon
  226.     (askchoice
  227.       (prompt "\nWhich icon would you like to install to Creation Disk?\n")
  228.       (default 0)
  229.       (choices "Normal" "GlowIcon")
  230.       (help @askchoice-help)
  231.     )
  232.   )
  233.   (set #icon 0)
  234. )
  235. (select #icon
  236.   (set #icon ("%sCreation.inf" @app-name))
  237.   (set #icon ("%sCreation.Glowicon" @app-name))
  238. )
  239.  
  240. (copyfiles
  241.   (help @copyfiles-help)
  242.   (source #icon)
  243.   (newname ("%sCreation.info" @app-name))
  244.   (dest #dest)
  245. )
  246.  
  247. (tooltype
  248.   (dest (tackon #dest @app-name))
  249.   (settooltype "Slave" ("%s.Slave" @app-name))
  250.   (settooltype "PreLoad" "")
  251.   (setdefaulttool "WHDLoad")
  252.   (setstack 10240)
  253.   (noposition)
  254. )
  255.  
  256.  
  257. (tooltype
  258.   (dest (tackon #dest "DrakkhenCreation"))
  259.   (settooltype "Slave" ("%sCreation.Slave" @app-name))
  260.   (settooltype "PreLoad" "")
  261.   (setdefaulttool "WHDLoad")
  262.   (setstack 10240)
  263.   (noposition)
  264. )
  265.  
  266.  
  267. (if
  268.   (exists #readme-file)
  269.   (copyfiles
  270.     (help @copyfiles-help)
  271.     (source #readme-file)
  272.     (dest #dest)
  273.   )
  274. )
  275.  
  276. (if
  277.   (exists #cheat-file)
  278.   (copyfiles
  279.     (help @copyfiles-help)
  280.     (source #cheat-file)
  281.     (dest #dest)
  282.   )
  283. )
  284.  
  285. (if
  286.   (exists #save-file)
  287.   (copyfiles
  288.     (help @copyfiles-help)
  289.     (source #save-file)
  290.     (dest #dest)
  291.   )
  292. )
  293.  
  294. (if
  295.   (exists #osemu-file)
  296.   (copyfiles
  297.     (help @copyfiles-help)
  298.     (source #osemu-file)
  299.     (dest #dest)
  300.   )
  301. )
  302.  
  303. (if
  304.   (exists ("%s.info" #readme-file))
  305.   (
  306.     (copyfiles
  307.       (help @copyfiles-help)
  308.       (source ("%s.info" #readme-file))
  309.       (dest #dest)
  310.     )
  311.     (tooltype
  312.       (dest (tackon #dest #readme-file))
  313.       (noposition)
  314.     )
  315.   )
  316. )
  317. (if
  318.   (exists #highs-file)
  319.   (copyfiles
  320.     (help @copyfiles-help)
  321.     (source #highs-file)
  322.     (dest #dest)
  323.   )
  324. )
  325.  
  326. (P_MakeImages)
  327.  
  328. ;(P_RenameImages)
  329.  
  330.  
  331.      
  332.  
  333. ;----------------------------
  334.  
  335. (exit)
  336.  
  337.